package com.wang.gulimall.member.feign;

import com.wang.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

//会员服务调用优惠券服务的feign接口

//（）里面写想要调用的服务在注册中心中的name值
@FeignClient("gulimall-coupon")
public interface CouponFeignService {

    //会员服务调用优惠券服务，查看该会员的优惠信息
    @RequestMapping("/coupon/coupon/member/list")
    R membercoupon();

    //远程调用携带参数
    /*
    get类型请求如果携带参数需要加上@RequestParam注解
    post类型请求如果携带参数 @RequestBody
     */
    @GetMapping("/coupon/coupon/feignWithParm")
    R openFeign(@RequestParam("a")String a, @RequestParam("b")Integer b);

}
